package com.qby.framework.filter.param;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @description: 参数过滤器
 * @author: qiu bo yang
 * @create: 2020-03-26 18:12
 */
public class ParamsFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        HttpServletRequest request = (HttpServletRequest) servletRequest;
        HttpServletResponse response = (HttpServletResponse) servletResponse;
        ParameterRequestWrapper paramsRequest = new ParameterRequestWrapper(request);
        filterChain.doFilter(paramsRequest, servletResponse);
    }

    @Override
    public void destroy() {

    }
}
